package com.example.manager.Utils;
import com.example.manager.retrofit.ApiService;

import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class RetrofitManager {
    public static final String BASE_URL = "http://124.93.196.45:10001";
    private static Retrofit retrofit;
    private static ApiService apiService;

    private RetrofitManager() {
        retrofit = new Retrofit.Builder()
                .baseUrl(BASE_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .build();

        apiService = retrofit.create(ApiService.class);
    }

    public static ApiService getApiService() {
        if (apiService == null) {
            apiService = new RetrofitManager().apiService;
        }
        return apiService;
    }
}
